<template>
	<view class="content" :style="{ height: windowHeight + 'px' }">
		<view class="view">
			<view class="header line" v-if="ranking">
				<view class="points">
					<view class="points_point red">
						1
					</view>
				</view>
				<view class="header_bottom red">
					<text>恭喜您在本次竞赛获得第一名</text>
				</view>
			</view>
			<view class="bottom" v-if="ranking">
				<view class="title">
					邀请您参加线下竞赛
				</view>
				<view class="items">
					<view class="label">
						竞赛地址：
					</view>
					<view class="value">
						{{ address }}
					</view>
				</view>
				<view class="items">
					<view class="label">
						竞赛时间：
					</view>
					<view class="value">
						{{ date }}
					</view>
				</view>
				<view class="items">
					<view class="label">
						竞赛注意：
					</view>
					<view class="value">
						{{ pre }}
					</view>
				</view>
			</view>
			<view class="titles" v-if="!ranking">
				<view class="titles_top">
					你的排名超出了100名
				</view>
				<view class="titles_bottom">
					加油，努力下次再参赛
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		systemInfo
	} from '../../utils/mixin'
	import { competitionId } from '@/api/index'
	export default {
		components: {},
		mixins: [systemInfo],
		data() {
			return {
				address: '',
				date: '',
				pre: '',
				ranking: true
			}
		},
		onLoad(options) {
			// 状态栏高度
			this.getSystemInfo();
			uni.setNavigationBarTitle({
				title: options.title
			})
			this.getDetail(options.id)
		},
		methods: {
			// 获取详情
			async getDetail(id){
				const res = await competitionId(id)
				this.address = res.data.nextAddr
				this.date = res.data.nextTime
				this.pre = res.data.nextRemark
			}
		}
	}
</script>

<style lang="less" scoped>
	.content {
		background-color: rgb(245, 245, 245);
		width: 100%;
		box-sizing: border-box;

		.red {
			color: red !important;
		}

		.line {
			border-bottom: 1px solid rgba(179, 173, 173, 0.2);
		}

		.view {
			width: calc(100% - 60rpx);
			height: calc(100% - 60rpx);
			margin-top: 30rpx;
			box-sizing: border-box;
			padding: 30rpx;
			background-color: #fff;
			position: relative;
			top: 30rpx;
			margin: auto;
			overflow: auto;
			border-radius: 15px;

			.header {
				margin: 90rpx 0;

				.points {
					font-size: 100rpx;
					color: red;
					display: flex;
					align-items: flex-end;
					justify-content: center;
					font-weight: 700;
					color: rgba(34, 175, 229);

					.points_pre {
						font-size: 26rpx;
						font-weight: normal;
						margin-bottom: 16rpx;
						margin-left: 10rpx;
					}
				}

				.header_bottom {
					margin-top: 30rpx;
					font-size: 30rpx;
					color: rgb(179, 173, 173);
					text-align: center;
					margin-bottom: 50rpx;
				}
				
			}
			
			.bottom{
				.title{
					font-size: 40rpx;
					text-align: center;
					letter-spacing: 2rpx;
					margin-bottom: 60rpx;
				}
				.items{
					display: flex;
					align-items: flex-start;
					font-size: 30rpx;
					margin-top: 30rpx;
					line-height: 2;
					.label{
						width: 160rpx;
					}
					.value{
						color: rgb(179, 173, 173);
						width: calc(100% - 160rpx);
						letter-spacing: 3rpx;
					}
				}
			}
			
			.titles{
				text-align: center;
				font-size: 35rpx;
				line-height: 2;
				font-weight: 500;
				margin-top: 200rpx;
				letter-spacing: 3rpx;
			}

			
		}
	}
</style>